#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//#include<assert.h>
//void* my_memcpy(void* dest, const void* sourse, size_t num) {
//	assert(dest && sourse);
//	char* stare = (char*)dest;
//	while(num--)
//	{
//		*(char*)dest = *(char*)sourse;
//		(char*)dest = (char*)dest + 1;
//		(char*)sourse= (char*)sourse + 1;
//	}
//	return stare;
//}
//int main() {
//	int arr1[5] = { 1,2,3,4,5 };
//	int arr2[10] = { 0 };
//	my_memcpy(arr2, arr1, 12);
//	return 0;
//}

#include<stdio.h>
#include<assert.h>
void* my_memmove(void*dest,void*sourse,size_t num) {
	assert(dest && sourse);
	char* stare = (char*)dest;
	if (dest > sourse)
	{
		while (num--)
				{
			*((char*)dest+num) = *((char*)sourse+num);
		}
		return stare;
	}
	else
		while(num--)
	{
		*(char*)dest = *(char*)sourse;
		(char*)dest = (char*)dest + 1;
		(char*)sourse= (char*)sourse + 1;
	}
	return stare;
}
int main() {
	int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
	int count;
	int i;
	for(i=0;i<10;i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
	my_memmove(arr + 1, arr, 12);
	for (i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}